Public Class userpassword
    Inherits System.Web.UI.Page
    Public Msg As String
    Public aUserSession(13) As String
    Public objvalid As New gaValidation
    Public imgpath, currtURL As String
#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents pwd As System.Web.UI.WebControls.TextBox
    Protected WithEvents pwd1 As System.Web.UI.WebControls.TextBox
    Protected WithEvents pwd2 As System.Web.UI.WebControls.TextBox
    Protected WithEvents btnUpDate As System.Web.UI.WebControls.Button
    Protected WithEvents btnCancel As System.Web.UI.WebControls.Button

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        objvalid.getURL(Request.Url.ToString, imgpath, currtURL)
    End Sub

    Private Sub btnUpDate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpDate.Click
        'If Request("action") = "Update" Then
        '    pwd = SafeString(Request.Form("pwd"))
        '    pwd1 = SafeString(Request.Form("Pwd1"))
        '    pwd2 = SafeString(Request.Form("Pwd2"))

        '    If pwd1 = "" Then
        '        Msg = "Please enter a new password to use"
        '    Else
        '        If pwd = pwd1 Then
        '            Msg = "You cannot use your current password as your new password."

        '        ElseIf (pwd1 <> pwd2) Then
        '            Msg = "Passwords don't match. Please enter the same password twice!"
        '        Else
        '            If Len(pwd1) < 6 Then
        '                Msg = "Please enter a minimum of six(6) characters. Your password must contain at least one letter and one number."

        '            ElseIf Len(pwd1) > 15 Then
        '                Msg = "Please enter a maximum of fifteen (15) characters. Your password must contain at least one letter and one number."

        '            End If
        '        End If
        '    End If

        '    If Msg = "" Then
        '        oChangect = CreateObject("viaUserManagement.UserManagement")
        '        oChangect.DBConnectString = Application("DSN")
        '        oChangect.SESSION_VIAKLIX_ID = aUserSession(cVIAKLIX_ID)
        '        oChangect.SESSION_USER_ID = aUserSession(cUSER_ID)
        '        oChangect.SESSION_COMPANY_ID = aUserSession(cCOMPANY_ID)
        '        '-----	BW 1/16/02 server ip, server time, and source ip auditing
        '        oChangect.ServerIP = safestring(Request.ServerVariables("LOCAL_ADDR"))
        '        oChangect.ServerTime = safestring(Now())
        '        oChangect.SourceIP = safestring(Request.ServerVariables("REMOTE_ADDR"))
        '        '-----	end server ip, server time, and source ip auditing
        '        changemsg = oChangect.ChangePassword(aUserSession(cUSER_ID), aUserSession(cCOMPANY_ID), aUserSession(cVIAKLIX_ID), pwd, pwd1)
        '        oChangect = Nothing
        '        If changemsg = "OK" Then
        '            Response.Redirect("default.asp")
        '        Else
        '            Msg = changemsg
        '        End If

        '    End If
        'End If

    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Response.Redirect("default.asp")

    End Sub
End Class
